home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
music4c.sit
/
Music4C Folder
/
Sources Folder
/
report.c
< prev
next >
Wrap
Text File
|
1990-06-08
|
1KB
|
53 lines
/*
* ⌐ Graeme Gerrard 1990
* Faculty of Music, University of Melbourne
* Parkville Victoria 3052 Australia.
*
* ARPANET: grae@murdu.ucs.unimelb.edu.au
* telephone: (613) 344 4127, Fax: (613) 344 5346
*/
#include "Music4C.h"
#include "Music4C_Prototype.h"
#include <string.h>
static long reportLen = 0L;
static char reportMess[MAXSTRING];
extern int ReportFileRefNum;
extern OSErr theErr;
extern Str255 theMess1;
void Report(theMess)
char *theMess;
{
int messLen;
messLen = strlen(theMess);
if ( (reportLen + messLen) >= MAXSTRING) {
if ( reportLen > 0 )
theErr = FSWrite(ReportFileRefNum, &reportLen, (char *)reportMess);
reportMess[0] = '\0';
reportLen = 0L;
strcpy((char *)reportMess, theMess);
}
else {
strcat((char *)reportMess, theMess);
}
reportLen = (long)strlen(reportMess);
if ( reportMess[reportLen-1] == '\n' ) {
reportMess[reportLen-1] = '\r'; /* sub 'newline' for 'return' */
if ( reportLen > 0 )
theErr = FSWrite(ReportFileRefNum, &reportLen, (char *)reportMess);
if ( theErr != noErr ) {
NumToString(theErr, &theMess1);
ParamText("\pProblem writing to Report file", theMess1, NIL, NIL);
A_ErrorAlert();
}
reportMess[0] = '\0';
reportLen = 0L;
}
}